﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VictorBlaga.DocumentManagement.Core.Models;
using VictorBlaga.DocumentManagement.Core.Models.Repositories;
using VictorBlaga.DocumentManagement.Infrastructure.DataAccess;

namespace VictorBlaga.DocumentManagement.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            IUserRepository userRepository;
            try
            {
                userRepository = new UserRepository();
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
                if(ex.InnerException!=null) System.Console.WriteLine(ex.InnerException.Message);
                throw;
            }
            //var managers = userRepository.GetByUserLevel((int)UserLevels.TeamManager);
            var users = userRepository.GetAvailableTeamManagers();

            foreach (var user in users)
            {
                System.Console.WriteLine(user.Fullname);
                System.Console.WriteLine(user.ManagesTeam);
            }
            System.Console.ReadLine();
        }
    }
}
